#include"../../client/rpc_client.hpp"
#include<thread>
void callback(const std::string &key,const std::string &msg){
    ILOG("%s主题收到推送的消息%s",key.c_str(),msg.c_str());
}
int main()
{
    //实例化客户端
    auto client=std::make_shared<bitpr::client::TopicClient>("127.0.0.1",7070);
    //创建主题
    bool ret=client->create("hello");
      if(ret==false){
        ELOG("创建主题失败");
    }
    //订阅主题
    ret=client->subscribe("hello",callback);
    //等待退出(消息不一定立即会过来)
    std::this_thread::sleep_for(std::chrono::seconds(10));
    client->shutdown();
    return 0;
}